package com.wangcang.widgetlibrary.face_demo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.iflytek.cloud.Setting;
import com.wangcang.widgetlibrary.R;

/**
 * 人脸识别示例
 */
public class FaceDemoActivity extends Activity implements OnClickListener {

	private Button onlineBtn;
	private Button offlineBtn;
	private Button videoBtn;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_facedemo_main);

		onlineBtn = (Button) findViewById(R.id.btn_online_demo);
		offlineBtn = (Button) findViewById(R.id.btn_offline_demo);
		videoBtn = (Button) findViewById(R.id.btn_video_demo);

		onlineBtn.setOnClickListener(this);
		offlineBtn.setOnClickListener(this);
		videoBtn.setOnClickListener(this);

		Setting.setShowLog(true);
	}

	@Override
	public void onClick(View v) {
		Intent intent = null;

		if(v.getId() == R.id.btn_online_demo){
			intent = new Intent(FaceDemoActivity.this, OnlineFaceDemo.class);
			startActivity(intent);
		}else if(v.getId() == R.id.btn_offline_demo){
			intent = new Intent(FaceDemoActivity.this, OfflineFaceDemo.class);
			startActivity(intent);
		}else if(v.getId() == R.id.btn_video_demo){
			intent = new Intent(FaceDemoActivity.this, VideoDemo.class);
			startActivity(intent);
		}

	}
}
